package web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import biz.DeptBiz;
import entity.Dept;

public class ViewAllDeptServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
    public ViewAllDeptServlet() {
        super();
    }
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		DeptBiz deptBiz = new DeptBiz();
		List<Dept> list = deptBiz.selectAllDept();
		request.setAttribute("list", list);
		
		String str = request.getParameter("flag");
		if(str!=null)
			request.setAttribute("flag", Boolean.parseBoolean(str));
		request.getRequestDispatcher("CreateUser.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
